app.service('shopDeliveryService',['$q','utilService',function($q,utilService){
    var _this_=this;
    //查询配送信息
    _this_.queryAll= function ($scope) {
        var deferred = $q.defer();
        utilService.get({
            url:$scope.app.domain + 'shop/delivery',
            data:{sessionId:$scope.sessionId}
        }).then(function(response){
            deferred.resolve(response.data);
        },function(e){
            console.error(e);
            deferred.reject("连接服务器出错！");
        })
        return deferred.promise;
    }

    _this_.delete= function ($scope) {
        var deferred = $q.defer();
        utilService.api({
            method:'DELETE',
            url:$scope.app.domain + 'shop/delivery',
            data:{'shopDeliveryId':$scope.shopDeliveryId}
        }).then(function(response){
            deferred.resolve(response);
        },function(e){
            console.error(e);
            deferred.reject("连接服务器出错！");
        })
        return deferred.promise;
    }

}])